Resolve Task (Streaming)
Resolves a pending task in a chat and returns a Server-Sent Events stream. Events include the initial assistant-message snapshot, content chunk deltas, final usage, and a closing message snapshot. The response is `text/event-stream`; each event is `data: <JSON>\n\n` where the JSON conforms to MessageStreamEvent.
Usage
import { v0 } from 'v0-sdk'const result = await v0.messages.resolveStream({ chatId: 'chat_abc123', task: 'confirmed-steps',})console.log(result)API Signature
Request
Path Parameters
The unique identifier of the chat.
Request Body
The task resolution data. The latest message in the active chat fork must be an assistant message blocked on the matching task type.
Overrides for the model behavior.
Model to use for the generation.
Enables image generations to generate up to 5 images per version.
Response (Stream)
The response is a text/event-stream. Each event is data: <JSON>\n\n where the JSON conforms to one of the following event types:
A single Server-Sent Events payload emitted by the streaming send-message endpoint. Each SSE event is data: <JSON>\n\n where the JSON conforms to one of the union members.
Unique message identifier.
ID of the chat this message belongs to.
Who produced this message.
ISO timestamp when the message was created.
ISO timestamp when the message was last updated.
The trailing prose of the message — the agent’s closing summary, or the user’s message text. Empty string when there is no closing prose.
Ordered list of parts that make up the message. Iterate to render the full narrative including thinking, file operations, tool calls, and prose.
A block of text output by the agent.
Markdown prose written by the agent or user.
ISO timestamp when this part began.
ISO timestamp when this part completed.
Why generation ended. Null while the agent is still generating; once non-null, the message is final and safe to consume.
Files attached to this message.
URL to the attachment.
Original filename, when available.
MIME type.
Size in bytes.
ID of the user who authored a user message; null for assistant messages.
Token usage and credit cost. All values are zero on user messages and on assistant messages that have not yet generated tokens.
Token counts for this message.
Prompt input value (non-cached).
Completion output value.
Cache-read input value.
Cache-write input value.
Sum of input, output, cacheRead, and cacheWrite.
Credit cost for this message.
Prompt input value (non-cached).
Completion output value.
Cache-read input value.
Cache-write input value.
Sum of input, output, cacheRead, and cacheWrite.
Initial and final message-state event. Emitted once at stream open with the freshly-created assistant message (empty parts, null finishReason), and once at stream close with the completed message.
Resolve Task (Async)
Resolves a pending task and processes it in the background. Returns immediately with the assistant message ID. Poll GET /chats/:chatId/messages/:messageId and check `finishReason` to detect completion.
Send Message
Sends a new message to an existing chat. Blocks until the model response is complete and returns the message response.